/**
 *    @file       udprecvthread.h
 *
 *    @brief      udpsendthread must start before udprecvthread starts in linux system for udp socket resuable property.
 *                by contraries, udpsendthread must start after udprecvthread starts in freebsd system.
 *    @details
 *
 *    @version    1.0
 *    @date       02/19/2014 02:17:39 PM
 *
 *    @author     Theophilus (), wangtf418@gmail.com
 */
#ifndef _SF_UDPRECVTHREAD_H_
#define _SF_UDPRECVTHREAD_H_
#include "workthread.h"
#include "sockbase.h"

class udprecvthread :public workthread
{
public:
	udprecvthread(bf_uint32_t type, bf_uint32_t size, bf_uint32_t index, const comargs *args);
	virtual ~udprecvthread();

public:
	virtual bf_int_t init();
	virtual bf_int_t run();

public:
	virtual void init_run();
	virtual void uninit_run();

protected:
	csocket* m_socket;
	bf_char_t m_recvbuf[UDP_RECV_BUF_LEN];
	struct sockaddr_in m_addr;
};

#endif

